import 'package:flutter_test/flutter_test.dart';
import 'package:lib_draw_text/lib_draw_text.dart';
import 'package:lib_draw_text/lib_draw_text_platform_interface.dart';
import 'package:lib_draw_text/lib_draw_text_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockLibDrawTextPlatform
    with MockPlatformInterfaceMixin
    implements LibDrawTextPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<T?> invokeMethod<T>(String method, [arguments]) {
    throw UnimplementedError();
  }
}

void main() {
  final LibDrawTextPlatform initialPlatform = LibDrawTextPlatform.instance;

  test('$MethodChannelLibDrawText is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelLibDrawText>());
  });

  test('getPlatformVersion', () async {
    LibDrawText libDrawTextPlugin = LibDrawText.instance;
    MockLibDrawTextPlatform fakePlatform = MockLibDrawTextPlatform();
    LibDrawTextPlatform.instance = fakePlatform;

    expect(await libDrawTextPlugin.getPlatformVersion(), '42');
  });
}
